The present invention relates to programming and control systems. More particularly, this invention relates to flowchart-based programming and control systems that call external functions from the flowchart.
Programming and control systems are generally used for controlling processes that involve devices such as relays, solenoids, motors, valves, switches, and other electrical and electromechanical devices. The processes that are controlled include machining, drilling, welding, spraying paint, mixing materials, assembling parts, handling materials, etc. Conventional programming and control systems generally used ladder diagrams and relay ladder logic (RLL) to control the operation of the devices associated with the processes. In practice, however, programmers tend to use a flowchart to initially define the operation of the devices in the process. Then, the programmers manually translate the flowchart into the ladder diagrams. The programmers employ the flowcharts as a first step because the flowcharts emulate human thought processes whereas the ladder diagrams do not.
Flowcharts generally include action blocks which represent an operation or action based on current input and output data. Action blocks generally have one entry point at the top and one exit point at the bottom. A branching or decision block is a diamond-shaped block which represents a branch in the control path based on the results of a decision. Branching blocks generally have one entry point at the top and two exit points at the side and the bottom. Using the action and branching blocks, a programmer creates a flowchart which controls one or more devices that are associated with a process. In contrast, some RLL controllers include over two hundred distinct instructions which are understandably difficult to remember, let alone implement. Flowcharts dramatically simplify the programming and control of the devices. One flowchart-based system is disclosed in xe2x80x9cContinuous Flowchart, Improved Data Format and Debugging System For Programming and Operation of Machinesxe2x80x9d, U.S. Pat. No. 4,852,047, which is hereby incorporated by reference.
A significant problem encountered with both flowchart-based and RLL-based programs is the integration of custom functions such as proprietary algorithms, complex mathematical calculations, and/or other application-specific functions. As a programmer, it is impossible to accommodate all of the unique applications for a programming and control system in advance. Even if it could be done, the resulting system would require too much memory and other system resources. If the proprietary algorithms and/or special functions are incorporated into the flowchart-based program, any corrections, changes, or improvements to the algorithms and/or special functions may affect the operation of the entire program.
The flowchart-based programming and control system according to the invention provides an open programming environment. The system incorporates external functions which can be called from flowchart blocks. The external functions are loaded during run time only when they are needed. Therefore, the external functions do not consume system memory until they are used. Because the external functions are stored in a separate file, a programmer can make corrections, changes, and/or improvements to the external function without affecting the operation of the flowchart-based programming and control system which calls the external function. Furthermore, because the external function may contain an external function that is used in a variety of circumstances, the programmer can reuse external function for multiple flowchart-based programming and control applications as well as non-flowchart based programs.
For a more complete understanding of the invention, its objects and advantages, reference may be had to the following specification and to the accompanying drawings.